package com.medisign.sign.log.constant;

public enum ActionEnum {


    // --------------------------医生端--------------------------

    // 用户
    get_access_token("getAccessToken", "/api/v1.0/getAccessToken", "获取token"),
    import_user("importUser", "/api/v1.0/user/import?accessToken=", "导入用户"),
    update_user("updateUser", "/api/v1.0/user/update?accessToken=", "更新用户"),
    delete_user("deleteUser", "/api/v1.0/user/delete/{userId}?accessToken=", "删除用户"),
    freeze_user("freezeUser", "/api/v1.0/user/freeze/{userId}?accessToken=", "冻结用户"),
    unfreeze_user("unfreezeUser", "/api/v1.0/user/unfreeze/{userId}?accessToken=", "解冻用户"),
    get_user_info("getUserInfo", "/api/v1.0/user/info?accessToken=", "获取用户信息"),


    // 授权
    start_OAuth("startOAuth", "/api/v1.0/auth/oauth?accessToken=", "发起授权"),
    get_Oauth_Status("getOauthStatus", "/api/v1.0/auth/getOauthStatus?accessToken=", "事务编号查询授权"),
    get_Oauth_By_UserId("getOauthByUserId", "/api/v1.0/auth/getOauthByUserId?accessToken=", "用户编号查询授权"),
    cancel_auth_by_transactionId("cancelAuthByTransactionId", "/api/v1.0/cancel/auth/oauth?accessToken=", "事务编号取消授权"),
    cancel_auth_by_userId("cancelAuthByUserId", "/api/v1.0/cancelAuthByUserId?accessToken=", "用户编号取消授权"),


    // 数据
    get_hash("getHash", "/api/v1.0/sign/getHash?accessToken=", "获取SM3摘要"),
    p1_sign("p1Sign", "/api/v1.0/sign/signdata?accessToken=", "p1签"),
    p1_multi_sign("p1Sign", "/api/v1.0/sign/multiSignData?accessToken=", "p1批量签"),
    p7_sign("p7Sign", "/api/v1.0/sign/signDataP7?accessToken=", "p7签"),
    p7_postposition_sign("p7PostpositionSign", "/api/v1.0/sign/dataP7/postposition?accessToken=", "p7后置签"),
    verify_p1_data("verifyP1Data", "/api/v1.0/sign/verifyData?accessToken=", "p1验证"),
    verify_p7_data("verifyP7Data", "/api/v1.0/sign/verifyDataP7?accessToken=", "p7验证"),

    // 文件
    file_sign("fileSignV1", "/api/v1.0/sign/signFile?accessToken=", "文件自动签V1"),
    sign_template_file("signTemplateFile", "/api/v1.0/sign/signTemplateFile?accessToken=", "模板文件签名"),
    sign_file_manual("signFileByManual", "/api/v1.0/sign/signFileByManual?accessToken=", "文件后置签"),
    get_sign_status("getSignStatus", "/api/v1.0/sign/getSignStatus?accessToken=", "获取签署状态"),
    get_sign_By_TransactionId("getSignByTransactionId", "/api/v1.0/sign/getSignByTransactionId?accessToken=", "事务编号查询授权"),
    cancel_sign("cancelSign", "/api/v1.0/sign/cancelSign?accessToken=", "取消签署"),
    delete_sign("deleteSign", "/api/v1.0/sign/deleteSign?accessToken=", "删除签署"),
    down_file("downFile", "/api/v1.0/file/downFile?accessToken=", "下载文件base64"),
    verify_File_By_Base64("verifyFileByBase64", "/api/v1.0/sign/verifyFile?accessToken=", "验证文件base64"),
    verify_File_By_FileCode("verifyFileByFileCode", "/api/v1.0/sign/verifyFileByFileCode?accessToken=", "验证文件fileCode"),


    // 图片
    download_sign_image("downloadSignImage", "/api/v1.0/download/signImage?accessToken=", "图片格式转换"),
    image_convert("imageConvert", "/api/v3.0/sign/imageConvert?accessToken=", "图片格式转换"),

    // 时间戳
    sign_timestamp("signTimestamp", "/api/v1.0/tsa/timeStamp?accessToken=", "图片格式转换"),
    verify_timestamp("verifyTimestamp", "/api/v1.0/tsa/verifyTsa?accessToken=", "图片格式转换"),

    // --------------------------患者端--------------------------
    patient_upload_base64("patientUploadBase64", "/patient/api/v2.0/uploadBase64?accessToken=", "患者端上传文件"),
    patient_template_fill("patientTemplateFill", "/patient/api/v2.0/templateFill?accessToken=", "患者模版填充"),
    patient_sign_file_Pad("patientSignFileByPad", "/patient/api/v3.0/sign/signFileByPad?accessToken=", "患者屏签发起"),
    patient_get_fileCode("patientGetFileCode", "/patient/api/v3.0/sign/getFileCode?accessToken=", "患者获取文件编号"),
    patient_get_sign_status("patientGetFileCode", "/patient/api/v3.0/sign/getSignStatus?accessToken=", "患者获取签署状态"),
    patient_cancel_order_sign("patientCancelOrderSign", "/patient/api/v3.0/sign/cancel?accessToken=", "患者取消订单签署"),
    patient_delete_order_sign("patientDeleteOrderSign", "/patient/api/v3.0/sign/delete?accessToken=", "患者删除订单签署"),
    patient_down_file("patientDownFile", "/patient/api/v1.0/file/downFile?accessToken=", "患者下载文件base64"),
    patient_verify_File_By_Base64("patientVerifyFileByBase64", "/patient/api/v1.0/sign/verifyFile?accessToken=", "患者验证文件base64"),
    patient_image_convert("patientImageConvert", "/patient/api/v3.0/sign/imageConvert?accessToken=", "患者图片格式转换"),
    ;

    private String key;
    private String value;
    private String desc;

    ActionEnum(String key, String value, String description) {
        this.key = key;
        this.value = value;
        this.desc = description;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static ActionEnum getByKey(String key){
        if(null == key){
            return null;
        }
        for(ActionEnum temp:ActionEnum.values()){
            if(temp.getKey().equals(key)){
                return temp;
            }
        }
        return null;
    }
}
